<div class="layuimini-container">
    <div class="layuimini-main">
        <fieldset id="searchFieldset_currentTable" class="table-search-fieldset layui-hide">
            <legend>{:lang("common.condition_search")}</legend>
            <form class="layui-form layui-form-pane form-search">
                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("route.start_start")}</label>
                    <div class="layui-input-inline">
                        <input name="r_start_ge" class="layui-input cssDate"
                               placeholder="{:lang('common.choose')}{:lang('route.start_start')}"
                               value="{$param.r_start_ge|default=''}">
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("route.start_end")}</label>
                    <div class="layui-input-inline">
                        <input name="r_start_le" class="layui-input cssDate"
                               placeholder="{:lang('common.choose')}{:lang('route.start_end')}"
                               value="{$param.r_start_le|default=''}">
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("template.destination_id")}</label>
                    <div class="layui-input-inline">
                        <select name="province_id_eq">
                            <option value="">{:lang("common.choose")}{:lang("common.province_name")}</option>
                            {foreach :provinceList() as $val}
                            <option value="{$val.id}">{$val.name}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("template.code")}</label>
                    <div class="layui-input-inline">
                        <input name="t_code_like" class="layui-input" value="{$param.t_code_like|default=''}"
                               placeholder="{:lang('common.input')}{:lang('template.code')}">
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("template.name")}</label>
                    <div class="layui-input-inline">
                        <input name="t_name_like" class="layui-input" value="{$param.t_name_like|default=''}"
                               placeholder="{:lang('common.input')}{:lang('template.name')}">
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("template.days")}</label>
                    <div class="layui-input-inline">
                        <select name="t_days_eq">
                            <option value="">{:lang("common.choose")}{:lang("template.days")}</option>
                            {for start="1" end="16"}
                            <option value="{$i}">{$i}{:lang('common.day_unit')}</option>
                            {/for}
                        </select>
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("common.status")}</label>
                    <div class="layui-input-inline">
                        <select name="r_status_eq" default-value="{$ROUTE_PUBLISHING}"
                                data-select-type="route_status_list"
                                data-select-default="{:lang('common.choose')}">
                        </select>
                    </div>
                </div>

                <div class="layui-form-item layui-inline" style="margin-left:50px">
                    <button type="submit" class="layui-btn layui-btn-normal" data-type="tableSearch"
                            lay-submit lay-filter="search_currentTable">{:lang("common.btn_search")}
                    </button>
                </div>
            </form>
        </fieldset>

        <table id="currentTable"
               data-auth-edit="{:auth(request()->controller().'/edit')}"
               data-auth-delete="{:auth(request()->controller().'/delete')}"
               data-auth-print="{:auth(request()->controller().'/print')}"
               data-auth-export="{:auth(request()->controller().'/export')}">
        </table>
    </div>
</div>
<script>
    layui.use(['myApp'], function () {
        let myCommon = layui.myCommon;

        myCommon.table.render({
            where: myCommon.generateCondition()
            , limit: "{$param.limit|default='15'}"
            , cols: [[
                {type: "checkbox"}
                , {field: 'id', title: '{:lang("common.id")}', width: 60, sort: true}
                , {field: 'start', width: 100, title: '{:lang("route.start")}', sort: true}
                , {field: 'code', width: 70, title: '{:lang("template.code")}', sort: true}
                , {field: 'destination_name', width: 80, title: '{:lang("template.destination_id")}', sort: true}
                , {field: 'days', width: 60, title: '{:lang("template.days")}', sort: true}
                , {field: 'name', minWidth: 80, title: '{:lang("template.name")}'}
                , {field: 'person_num', width: 60, title: '{:lang("route.person_num")}', sort: true}
                , {
                    field: 'adult_market_price', width: 75, title: '{:lang("route.market_price")}', sort: true
                    , templet: myCommon.table.trimMoney
                }
                , {
                    field: 'adult_peer_price', width: 75, title: '{:lang("route.peer_price")}', sort: true
                    , templet: myCommon.table.trimMoney
                }
                , {
                    field: 'adult_cost_price', width: 75, title: '{:lang("route.cost_price")}', sort: true
                    , templet: myCommon.table.trimMoney
                }
                , {
                    field: 'status', width: 80, title: '{:lang("common.status")}', sort: true,
                    templet: myCommon.table.type, typeList: 'route_status_list'
                }
                , {
                    width: 94, title: '{:lang("common.operate")}', templet: myCommon.table.tool,
                    operat: ['edit', 'delete']
                }
            ]]
        });
        myCommon.listen();
    });
</script>
